package com.ts.api.module.product.entity.qo;

import com.gitee.apanlh.util.base.StringUtils;
import com.gitee.apanlh.util.date.DateUtils;
import com.gitee.apanlh.util.date.format.DateTimeFormat;
import lombok.Data;

/**
 *  机构计划进件数查询对象
 *
 *  @author Pan
 */
@Data
public class ProductPlanLimitQO {

    /** 计划ids */
    private Long planId;
    /** 开始时间 */
    private String startTime;
    /** 结束时间 */
    private String endTime;

    /**
     *  创建查询对象为当天时间
     *
     *  @param  planId
     *  @return ProductPlanLimitQO
     */
    public static ProductPlanLimitQO createByNowTime(Long planId) {
        String date = DateUtils.currentTime(DateTimeFormat.DATE_FULL);
        ProductPlanLimitQO productPlanLimitQO = new ProductPlanLimitQO();
        productPlanLimitQO.setPlanId(planId);
        productPlanLimitQO.setStartTime(StringUtils.append(date, " 00:00:00"));
        productPlanLimitQO.setEndTime(StringUtils.append(date, " 23:59:59"));
        return productPlanLimitQO;
    }
}
